package com.tj.controller;


import com.tj.pojo.Category;
import com.tj.pojo.ShoppingCart;
import com.tj.service.ShoppingCartService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
@RequestMapping("/shoppingCart")
public class ShoppingCartController {
    @Autowired
    ShoppingCartService shoppingCartService;

    @GetMapping("/list")
    private Result<List<ShoppingCart>> getCategoryList() {

        //1.获取所有菜品
        List<ShoppingCart> res = shoppingCartService.getAll();

        //2.返回结果
        return  Result.success(res);

    }
}
